package com.fanqwz.kotlinmvvm.di.module

import android.app.Activity
import android.arch.lifecycle.LifecycleOwner
import android.support.v7.widget.Toolbar
import com.fanqwz.kotlinmvvm.common.util.log.MyLogger
import com.fanqwz.kotlinmvvm.common.util.log.getLogger
import com.fanqwz.kotlinmvvm.di.scope.PerActivity
import com.fanqwz.kotlinmvvm.ui.activity.BaseActivity
import dagger.Binds
import dagger.Module
import dagger.Provides

/**
 * Created by fanqwz on 2017/10/31.
 */
@Module
abstract class BaseActivityModule<T : BaseActivity> {
//    @Provides
//    @PerActivity
//    fun provideToolBar(): Toolbar = baseActivity.activityBaseBinding.toolbar

//    @Provides
//    @PerActivity
//    fun provideLogger(baseActivity: T): MyLogger {
//        return getLogger(baseActivity::class.java)
//    }

    @Binds
    @PerActivity
    abstract fun provideLifeCycleOwner(activity: T): LifecycleOwner
}